# -*- coding: utf-8 -*-
#Under the terms of the General Public License v.3
#For more information see LICENSE.txt

import pygame
from element import *

def pathToImage(imageFile):
	return PATH_TO_IMAGES + imageFile

def getImage(type):
	return pygame.image.load(images[type]).convert_alpha()

PATH_TO_IMAGES = "data/image/"
AP_IMAGE = "ap.png"
ROBOT_IMAGE = "robot.png"
HUMAN_IMAGE = "human.png"
ITEM_GOOD_FAST_IMAGE = "faster.png"
ITEM_GOOD_MEM_IMAGE = "memory.png"
ITEM_GOOD_AP_IMAGE = "goodap.png"
ITEM_GOOD_KILL_IMAGE = "killer.png"
ITEM_GOOD_EVOLUTIVE_IMAGE = "evolution.png"
ITEM_BAD_STOP_IMAGE = "stopper.png"
ITEM_BAD_SLOW_IMAGE = "slower.png"
ITEM_BAD_AP_IMAGE = "badap.png"

AP = 0x80
ROBOT = AP + 1
HUMAN = ROBOT + 1
ITEM_GOOD_FAST = HUMAN + 1
ITEM_GOOD_MEM = ITEM_GOOD_FAST + 1
ITEM_GOOD_AP = ITEM_GOOD_MEM + 1
ITEM_GOOD_KILL = ITEM_GOOD_AP + 1
ITEM_GOOD_EVOLUTIVE = ITEM_GOOD_KILL + 1
ITEM_BAD_STOP = ITEM_GOOD_EVOLUTIVE + 1
ITEM_BAD_SLOW = ITEM_BAD_STOP + 1
ITEM_BAD_AP = ITEM_BAD_SLOW + 1
# ahora lo cargo en un diccionario para hacer cosas mas pythonescas,
# no quito lo anterior porque no se dónde lo están usando
#formato:
# object_id : (class_name,r'path/to/image',('extra_params', more_extra_params, ...))
#if there is no need for extra parameters, then empty tuple
#i have set defaults values of extra parameters to =1 because I do not know what
#is the effect of each one
ELEMENT_DICT = {
		AP : (AccessPoint, pathToImage(AP_IMAGE), 1),#power = 1
		ROBOT : (Robot, pathToImage(ROBOT_IMAGE), None),
		HUMAN : (Human, pathToImage(HUMAN_IMAGE), 0, None),#level = 0, apList = None
		ITEM_GOOD_FAST : (ItemGoodFaster, pathToImage(ITEM_GOOD_FAST_IMAGE), 1),#fastpower = 1
		ITEM_GOOD_MEM : (ItemGoodMemory, pathToImage(ITEM_GOOD_MEM_IMAGE), 1),#memorypower = 1
		ITEM_GOOD_AP : (ItemGoodApTurnOn, pathToImage(ITEM_GOOD_AP_IMAGE), None),
		ITEM_GOOD_KILL : (ItemGoodKillHuman, pathToImage(ITEM_GOOD_KILL_IMAGE), None),
		ITEM_GOOD_EVOLUTIVE : (ItemGoodEvolutive, pathToImage(ITEM_GOOD_EVOLUTIVE_IMAGE), 1),#id = 1
		ITEM_BAD_STOP : (ItemBadStopper, pathToImage(ITEM_BAD_STOP_IMAGE), 1),#stoppower = 1
		ITEM_BAD_SLOW : (ItemBadSlower, pathToImage(ITEM_BAD_SLOW_IMAGE), 1),#slowpower = 1
		ITEM_BAD_AP : (ItemBadApTurnOff, pathToImage(ITEM_BAD_AP_IMAGE), None),
}
#hte folowing dictionary MUST be discarded
images = {}
images[AP] = pathToImage(AP_IMAGE)
images[ROBOT] = pathToImage(ROBOT_IMAGE)
images[HUMAN] = pathToImage(HUMAN_IMAGE)
images[ITEM_GOOD_FAST] = pathToImage(ITEM_GOOD_FAST_IMAGE)
images[ITEM_GOOD_MEM] = pathToImage(ITEM_GOOD_MEM_IMAGE)
images[ITEM_GOOD_AP] = pathToImage(ITEM_GOOD_AP_IMAGE)
images[ITEM_GOOD_KILL] = pathToImage(ITEM_GOOD_KILL_IMAGE)
images[ITEM_GOOD_EVOLUTIVE] = pathToImage(ITEM_GOOD_EVOLUTIVE_IMAGE)
images[ITEM_BAD_STOP] = pathToImage(ITEM_BAD_STOP_IMAGE)
images[ITEM_BAD_SLOW] = pathToImage(ITEM_BAD_SLOW_IMAGE)
images[ITEM_BAD_AP] = pathToImage(ITEM_BAD_AP_IMAGE)

